<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head><meta charset="utf-8"/><title>编辑产品</title></head>
<body>
<h2>编辑产品</h2>
<form th:action="@{/admin/products/save}" method="post">
    <input type="hidden" th:field="${p.id}"/>
    名称：<input th:field="${p.name}"/><br/>
    分类：<select th:field="${p.category}">
    <option>Gene Editing</option>
    <option>Service</option>
    <option>Reagent</option>
</select><br/>
    描述：<textarea th:field="${p.description}"></textarea><br/>
    图片URL：<input th:field="${p.imageUrl}"/><br/>

    <!-- 关键：Reagent 时禁用 -->
    <label>
        <input type="checkbox" th:field="${p.showOnHomepage}"
               th:disabled="${p.category == 'Reagent'}"/>
        显示在首页
        <span th:if="${p.category == 'Reagent'}" style="color:gray">（Reagent 暂不支持）</span>
    </label><br/>

    <button type="submit">保存</button>
</form>
</body>
</html>